<?php
class Zend_View_Helper_InvitationAttend {
	protected $_view;
	function setView($view) { 
		$this->_view = $view; 
	} 
	function invitationAttend($invitation,$invitedUser) {
		
	   $invitation_static = new Invitation();
	   $invitationResponse_static = new InvitationResponse();
	   
	   $this->_view->invitedUser = $invitedUser;
	   $this->_view->invitation = $invitation;
       $this->_view->response = $invitationResponse_static->findUnique($invitation->id, $invitedUser->id);
	   
	   $this->_view->selectYes = $invitation_static->findInvitationResponse($invitation->id, $invitation_static->select()->where('response = ?', 1));
	   $this->_view->selectNo = $invitation_static->findInvitationResponse($invitation->id, $invitation_static->select()->where('response = ?', 0));
	   $this->_view->selectMaybe = $invitation_static->findInvitationResponse($invitation->id, $invitation_static->select()->where('response = ?', 2));
       
	   $out = $this->_view->render('/invitation/InvitationAttend.phtml');
	   
       return $out;
	}
}
?>